//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>

#include "SearchPrositePattern.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {
  
  String* sequence = NULL;
  String* pattern  = NULL;
  
  if (argc < 3) {
    
    cout << "Error in the input parameters! Must by like: " << endl;
    cout << "./SearchPrositePatternInSequence <Sequence>";
    cout <<                                 " <Prosite Pattern>";
    cout << endl;
    
    return 0;
    
  }
  else {
    
    sequence = new String(argv[1]);
    pattern  = new String(argv[2]);
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "        Sequence : " << argv[1] << endl;
    cout << " Prosite Pattern : " << argv[2] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
  }
  
  SearchPrositePattern* searchPrositePattern = new SearchPrositePattern ();
  
  cout << "Searching Prosite Patterns..." << endl;
  searchPrositePattern->SearchPattern(sequence, pattern);
  
  cout << searchPrositePattern->ToString()->Out() << endl;
  
  cout << "Finished..." << endl << "Good Bye" << endl;
  
  if (searchPrositePattern) delete searchPrositePattern;
  if (sequence)             delete sequence;
  if (pattern)              delete pattern;

  return EXIT_SUCCESS;
  
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

